package com.rfid.assistant.activity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import com.rfid.assistant.R;
import com.rfid.assistant.activity.fragment.SafeDoorConfigFragment;

public class SafeDoorConfigActivity  extends AppCompatActivity {

    private SafeDoorConfigFragment mSafeDoorConfigFragment;

    public static void startActivity(Context context,String ip) {
        startActivity(context,ip,false,false);
    }

    public static void startActivity(Context context,String ip,boolean bluetooth,boolean isRemote) {
        Intent intent = new Intent();
        intent.putExtra("ip",ip);
        intent.putExtra("bluetooth",bluetooth);
        intent.putExtra("remote",isRemote);
        intent.setClass(context,SafeDoorConfigActivity.class);
        context.startActivity(intent);
    }


    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_safedoor_layout);
        mSafeDoorConfigFragment = (SafeDoorConfigFragment) getSupportFragmentManager().findFragmentById(R.id.safedoor);
    }

    @Override
    public void onBackPressed() {
        if (!mSafeDoorConfigFragment.handleBackPress()) {
            super.onBackPressed();
        }
    }
}
